<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ page import="com.glodon.paas.document.service.util.DocumentConfig" %>
<%@ page import="com.glodon.paas.document.web.util.SecurityUtils"%>
<%@ page import="com.glodon.paas.account.api.bean.User"%>
<%  response.reset();
	response.setCharacterEncoding("UTF-8");
	response.setContentType("text/html");
	request.setAttribute("path",request.getContextPath());
	request.setAttribute("accountURL", DocumentConfig.ACCOUNT_SERVER_URL);
	request.setAttribute("documentURL", DocumentConfig.DOCUMENT_SERVER_URL);
	request.setAttribute("databagURL", DocumentConfig.DATABAG_SERVER_URL);
	User user = SecurityUtils.getCurrentUser();
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<link rel="shortcut icon" href="${path}/images/favicon.ico"  type="image/x-icon" />
		<title>广联云</title>
		<link rel="stylesheet" type="text/css" href="${path}/css/document.public.min.css" />
	</head>
	<body>
        <div class="hd" id="hd">
            <a class="glodon-logo" href="/document"></a>
            <a href="<%=DocumentConfig.DOCUMENT_SERVER_URL%>/public/file/download/${file.id}" class="download-btn" id="download-btn">下载</a>
            <%if(user == null) {%>
                <a href="/account/register" class="register-btn">注册</a>
            <%}%>
        </div>
        <div class="bd" id="bd">
            <div id="view-wrap" class="view-wrap"></div>
            <script>
	             window._global = window._global || { contextPath : "${path}" };
	             window._global.documentURL = "${documentURL}" ;
	             window._global.accountURL = "${accountURL}" ;
	             window._global.databagURL = "${databagURL}" ;
                 window.pageConfig = {
                      dataBagId: '${file.dataBagId}',
                      dataBagToken: '${file.attributes.databagToken}',
                      fileName: '${file.fullName}',
                      fileType: '${file.extension}',
                      isFolder: ${file.folder}
                 }
            </script>
        </div>
        <script type="text/javascript" src="${path}/js/document.public.min.js"></script>
	</body>
</html>
